/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2017
 */

package com.shop.pandian.app.model;

import java.sql.Timestamp;

import javax.persistence.*;

import org.hibernate.annotations.Cascade;
import org.hibernate.validator.constraints.*;

import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.validation.constraints.*;

import com.shop.pandian.framework.base.dao.BaseUpdatableEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * @author Xi Wei
 * @version 1.0
 * @since 1.0
 */
 @Entity
@Table(name = "pandian_history_detail")
public class PandianHistoryDetail extends BaseUpdatableEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;

	


	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	@NotNull @Max(2147483647)
	@Column(name = "available", unique = false, nullable = false, insertable = true, updatable = true, length = 10)
	private java.lang.Integer available; //available
	
	
	
	//columns END



	
	
	
	public java.lang.Integer getAvailable() {
		return this.available;
	}
	
	public void setAvailable(java.lang.Integer value) {
		this.available = value;
	}




	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	@JoinColumns({
		@JoinColumn(name = "product_id") 
	})
	private Product product;
	public void setProduct(Product product){
		this.product = product;
	}

	@JsonIgnore
	public Product getProduct() {
		return product;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	@JoinColumns({
		@JoinColumn(name = "pandian_history_id") 
	})
	private PandianHistory pandianHistory;
	public void setPandianHistory(PandianHistory pandianHistory){
		this.pandianHistory = pandianHistory;
	}

	@JsonIgnore
	public PandianHistory getPandianHistory() {
		return pandianHistory;
	}

}

